using System;
using System.Collections;
using System.Collections.Generic;
using Castle.ActiveRecord;


namespace Saffron.Framework.Users
{
    [ActiveRecord]
    public class UserAttributeGroup : ActiveRecordBase
    {
        private int _id;
        private string _name;
        private IList _attributes = new List<UserAttribute>();

        [PrimaryKey]
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        [Property]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [HasMany(typeof(UserAttribute), Table="UserAttribute", ColumnKey="UserAttributeGroupId")]
        public IList Attributes
        {
            get { return _attributes; }
            set { _attributes = value; }
        }

        public static UserAttributeGroup[] FindAll()
        {
            return (UserAttributeGroup[])FindAll(typeof(UserAttributeGroup));
        }

    }
}
